dnl	$OpenBSD: install,v 1.27 2014/03/19 01:59:49 tedu Exp $
OpenBSDInstallPrelude

There are several ways to install OpenBSD onto a disk. The easiest way
in terms of preliminary setup is to use the bootable CD-ROM mini image.
Alternatively, the OpenBSD ramdisk kernel can be booted from the network,
using a bootp/tftp server.

Booting from CD-ROM installation media:

  From the System Maintenance Menu, select '2' (or click on the
  appropriate icon if in graphics console) to Install System Software.

  If necessary, select the proper CD-ROM drive, and press enter to
  confirm your choice.  Insert the installation CD-ROM (if you did not
  do so already) and press enter to boot the system.

  If the boot is successful, you will get a loader version message,
  executable sizes, and then the kernel copyright and device probe
  messages. Boot failure modes are typically a lot of CD-ROM drive
  activity, but no messages or complaints about magic numbers,
  checksums or formats.

  If the system does not complain about being able to read the CD-ROM,
  but of not being able to load a particular file, you can nevertheless
  boot manually. This is the case on IP22 systems.

  To boot manually from the CD-ROM, select ``Enter Command Monitor''
  at the menu, and invoke the bootloader and ramdisk image manually.
  For example, on an IP22 system, automatic boot may fail with:

dnl IP22
	Cannot load scsi(1)cdrom(4)partition(8)sashARCS.
	Text start 0x10000, size 0xa120 doesn't fit in a FreeMemory area.
	Cannot load scsi(1)cdrom(4)partition(8)sashARCS -- not enough space.

  or:

dnl IP20, changed from scsi(0) to scsi(1) for consistency
	Cannot load scsi(1)cdrom(4)partition(8)sashARCS.
	Error 15 while loading scsi(1)cdrom(4)partition(8)sashARCS

  The name of the CD-ROM drive is then ``scsi(1)cdrom(4)'', and the manual
  boot command will be:

	>> scsi(1)cdrom(4)partition(8)bootecoff
	   scsi(1)cdrom(4)partition(0)/bsd.rd.IP22

  Note that this is a single commandline, the two paths should be separated
  with spaces.

Booting over the network:
dnl XXX provide more details!!!

  First, a bootp or dhcpd server needs to be set up. The bootpd(8) or
  dhcpd(8) manual page on your server should provide detailed information
  on how to set up the server.

  The PROM, by default, will configure itself to use the IP address set in
  the `netaddr' environment variable. To force the PROM to always get an
  address from a bootp or dhcp server, clear the variable (`unsetenv netaddr')
  before attempting to boot from the network. Alternatively, you may want to
  make sure the value of this variable is correct.

  Note that, if the `netaddr' variable is unset, the PROM will initialize it
  to the address obtained from the bootp or dhcp server.

  The bootp or dhcp server needs to know the ethernet address of the system.
  On Indigo, Indigo2, Indy and O2 systems, this address can be found by using
  the ``printenv'' command in the Maintenance Console, looking for the
  ``eaddr'' variable.
  On other systems, or if this variable is missing, this address is ususally
  written on a factory sticker on the back of the machine.

  The server should also provide a tftp location, where the proper bsd.rd
  file should be available.

	IMPORTANT! Older PROM are unable to connect to a tftp server
	on a port number greater than 32767; if booting stalls almost
	immediately, it might be necessary to restrict the tftp server
	to only use 15-bit port numbers.

	This situation can be detected by running tcpdump on the tftp
	server, and looking for icmp `port unreachable' errors from the
	MACHINE system.

dnl The following list is not intended to be exhaustive. Once enough samples
dnl are collected, it would be nice to be able to tell `PROM versions before
dnl that date are affected, PROM versions after that date are fine' rather
dnl than listing per-machine version strings. But then the actual cutoff
dnl point might differ accross systems, argh.
	The following PROM versions are known to exhibit this troublesome
	behaviour:
	- on Indigo:
	>> version
	PROM Monitor SGI Version 4.0.5G Rev B IP20,  Nov 10, 1992 (BE)
	- on Indy:
	>> version 
	PROM Monitor SGI Version 5.1 Rev B3 IP24 Sep 17, 1993 (BE)

	On the other hand, the following PROM versions are known to be
	unaffected by this problem:
	- on Indigo2:
	>> version
	PROM Monitor SGI Version 5.3 Rev C IP22 Oct 20, 1994 (BE)
	- on Indy:
	>> version
	PROM Monitor SGI Version 5.3 Rev B7 R4X00 IP24 Feb 16, 1995 (BE)
	PROM Monitor SGI Version 5.3 Rev B10 R4X00/R5000 IP24 Feb 12, 1996 (BE)

	Note that these lists do not pretend to be complete.

	If the server system runs OpenBSD, the following command can be
	used to enforce a safe port number:

	# sysctl net.inet.ip.portlast=32767

	don't forget to restore the previous value of this sysctl after
	the troublesome system has booted.

  Once the server is set up, boot with the following command in the
  Maintenance Console:

	>> bootp()bsd.rd.IP32

  (replacing `IP32' by the family name suitable for your machine).

  On IP22-class systems, or if the PROM complains about the file format,
  such as:

	>> bootp()bsd.rd.IP22
	[...]
	Cannot load bootp()bsd.rd.IP22.
	Problem reading elf structure at offset -2004877312.
	Unable to execute bootp()bsd.rd.IP22

  ... then this means that the PROM is too old to know about the ELF file
  format the OpenBSD kernel is provided in. In this case, the kernel needs
  to be booted from the ``bootecoff'' boot block, which has to be put on the
  tftp server as well, with:

	>> bootp()bootecoff bootp()bsd.rd.IP22

  If the boot aborts early with a memory related error message, such as:

	>> bootp()bootecoff bootp()bsd.rd.IP22
	[...]
	Cannot load bootp()bootecoff.
	Text start 0x80020f0, size 0xa030 doesn't fit in a FreeMemory area.
	Unable to execute bootp()/bootecoff

  ... then it is necessary to clean up after an earlier unsuccessful (or
  aborted) boot attempt. Just leave the PROM interactive mode with `exit',
  and at the maintenance menu, choose `Enter Command Monitor' again.

Installing the system:

OpenBSDInstallPart2

	Boot your machine from the installation media as described above.

	It will take a while to load the kernel especially from a slow
	network connection, most likely more than a minute.  If some action
	doesn't eventually happen, or the spinning cursor has stopped and
	nothing further has happened, either your boot media is bad, your
	diskless setup isn't correct, or you may have a hardware or
	configuration problem.

OpenBSDInstallPart3(,"sd0")

OpenBSDInstallPart4

OpenBSDInstallPart5

	No partitions should overlap with the SGI Volume Header, which by
	default will use the first 3134 sectors. Additionally, the 'a'
	partition must be the first partition on the disk, immediately
	following the SGI Volume Header. If the default Volume Header size is
	used, the 'a' partition should be located at offset 3135. If the 'a'
	partition is not located immediately after the Volume Header the boot
	loader will not be able to locate and load the kernel.
dnl XXX Note that this is a #$%@ boot blocks limitation which should be fixed
dnl XXX by reading the real label in the boot blocks.

OpenBSDInstallPart6({:-CD-ROM, NFS -:})

OpenBSDURLInstall

OpenBSDCDROMInstall

OpenBSDNFSInstall

OpenBSDDISKInstall(,{:-only -:})

OpenBSDCommonInstall

OpenBSDInstallWrapup

OpenBSDCongratulations



OpenBSDUnattendedInstallation
